home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-25 | 1.3 KB | 58 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CPongGameBehavior.h ©1999 Eric Traut
- // ===========================================================================
-
- #pragma once
-
- #include "COffscreenBehavior.h"
-
-
- typedef UInt16 PongGameState;
- enum
- {
- kPongGameStartState,
- kPongGameStatePlaying,
- kPongGameStateTearDown
- };
-
- class CPongGameBehavior : public COffscreenBehavior
- {
- public:
- CPongGameBehavior(CShadowWindow & inShadowWindow);
-
- virtual Boolean
- RenderToGWorld( StGWorldLocker & inBackingLocker,
- StGWorldLocker & inRenderingLocker);
-
- virtual void
- DoIdleTask( Boolean inGNETime);
-
- virtual void
- HandleEvent( EventRecord * ioEvent,
- Boolean * ioResult);
-
- static void
- Initialize( SndChannelPtr inSoundChannel);
-
- private:
- PongGameState mCurGameState;
- Point mBallLoc;
- Point mBallVector;
- SInt16 mLeftPaddleVHeight;
- SInt16 mRightPaddleVHeight;
- UInt32 mLastUpdateTicks;
- Boolean mColliding;
- SInt16 mLeftPaddleVDelta;
- SInt16 mRightPaddleVDelta;
-
- static PicHandle sLeftPaddlePICT;
- static PicHandle sRightPaddlePICT;
- static CIconHandle sBallIcon;
- static SndChannelPtr sSoundChannel;
- static SndListHandle sBootBeepSound;
- static SndListHandle sBootCrashSound;
- };
-
-
-
-